package com.xbongbong.saas.domain.entity;

import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author feng.zheng
 * @date  2020-01-10 10:58
 **/
@Getter
@Setter
@ToString
public class BatchFlowBillEntity implements Serializable{

    private static final long serialVersionUID = 2436013807285057490L;

    /**
     * 主键
     *
     */
    private Long id;
    /**
     * 公司id
     *
     */
    private String corpid;
    /**
     * 仓库id
     *
     */
    private Long warehouseId;
    /**
     *
     * 关联单据id
     *
     */
    private Long refId;

    private Long refProductId;
    /**
     *
     * 库存变化类型
     *
     */
    private Integer stockType;
    /**
     *
     * 父产品id
     *
     */
    private Long parentId;
    /**
     *
     * 产品id
     *
     */
    private Long productId;
    /**
     * 批次
     */
    private String batch;
    /**
     * 生产日期
     */
    private Long produceDate;
    /**
     * 保质期（秒）
     */
    private Long guaranteePeriod;
    /**
     * 到期日期（秒）
     */
    private Long expireDate;
    /**
     *
     * 单据编号
     *
     */
    private String refSheetNo;
    /**
     *
     * 往来单位id
     *
     */
    private Long businessId;
    /**
     *
     * 往来单位名称
     *
     */
    private String businessName;
    /**
     *
     * 出入库数量
     *
     */
    private Double num;

    /**
     *
     * 出入库单的产品成本
     *
     */
    private Double productCost;

    /**
     *
     * 结存总库存
     *
     */
    private Double remainingStock;

    /**
     *
     * 结存总成本
     *
     */
    private Double remainingCost;

    /**
     *
     * 流水发生时间
     *
     */
    private Long date;

    /**
     *
     * 业务类型
     *
     */
    private Integer businessType;

    /**
     *
     * 批次唯一key
     *
     */
    private String batchKey;

    private String memo;

    /**
     *
     * 添加时间
     *
     */
    private Long addTime;
    /**
     *
     * 更新时间
     *
     */
    private Long updateTime;
    /**
     *
     * 隐藏标志
     *
     */
    private Integer visible;
    /**
     *
     * 删除标志
     *
     */
    private Integer del;

    public BatchFlowBillEntity(String corpid, Long parentId, Long productId, Long warehouseId, String batch, Long produceDate, Long guaranteePeriod, Long expireDate, Long businessId, String businessName, Double num, Double productCost, Double remainingStock, Double remainingCost, Long date, Integer businessType, String batchKey, String memo, Long refProductId, Integer stockType, String refSheetNo, Long refId) {
        this.corpid = corpid;
        this.warehouseId = warehouseId;
        this.refId = refId;
        this.refProductId = refProductId;
        this.stockType = stockType;
        this.parentId = parentId;
        this.productId = productId;
        this.refSheetNo = refSheetNo;
        this.businessId = businessId;
        this.businessName = businessName;
        this.num = num;
        this.productCost = productCost;
        this.remainingStock = remainingStock;
        this.remainingCost = remainingCost;
        this.date = date;
        this.businessType = businessType;
        this.batchKey = batchKey;
        this.memo = memo;
        this.del = DelEnum.NORMAL.getDel();
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
        this.batch = batch;
        this.produceDate = produceDate;
        this.guaranteePeriod = guaranteePeriod;
        this.expireDate = expireDate;
        this.visible = 1;
    }

    public BatchFlowBillEntity(String corpid, Long parentId, Long productId, Long warehouseId, String batch, Long produceDate, Long guaranteePeriod, Long expireDate, Long businessId, String businessName, Double num, Double productCost, Double remainingStock, Double remainingCost, Long date, Integer businessType, String batchKey, String memo, Long refProductId, Integer stockType, String refSheetNo, Long refId, Long addTime) {
        this.corpid = corpid;
        this.warehouseId = warehouseId;
        this.refId = refId;
        this.refProductId = refProductId;
        this.stockType = stockType;
        this.parentId = parentId;
        this.productId = productId;
        this.refSheetNo = refSheetNo;
        this.businessId = businessId;
        this.businessName = businessName;
        this.num = num;
        this.productCost = productCost;
        this.remainingStock = remainingStock;
        this.remainingCost = remainingCost;
        this.date = date;
        this.businessType = businessType;
        this.batchKey = batchKey;
        this.memo = memo;
        this.del = DelEnum.NORMAL.getDel();
        this.addTime = addTime;
        this.updateTime = DateTimeUtil.getInt();
        this.batch = batch;
        this.produceDate = produceDate;
        this.guaranteePeriod = guaranteePeriod;
        this.expireDate = expireDate;
        this.visible = 1;
    }

    public BatchFlowBillEntity() {
        this.del = DelEnum.NORMAL.getDel();
        this.visible = 1;
    }
}
